package com.cineplanet.dew.dao;

import java.util.ArrayList;
import java.util.List;

import javax.sql.DataSource;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.cineplanet.dew.exception.DAOExcepcion;
import com.cineplanet.dew.modelo.EstadoCivil;
import com.cineplanet.dew.modelo.Pelicula;

public class EstadoCivilDAOImpl  extends HibernateDaoSupport implements EstadoCivilDAO {

	private DataSource dataSource;

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}
	
	@Override
	public List<EstadoCivil> listar() throws DAOExcepcion {
		List<EstadoCivil> arreglo = new ArrayList<EstadoCivil>();
		
		try {
			arreglo = getHibernateTemplate().find("from EstadoCivil");
		} catch (Exception e) {

			throw new DAOExcepcion(e.getMessage());
		}
		return arreglo;
	}

}
